<template>
  <span>
    <template v-if="nodetype === 'odoofield'">
      <OdooWidget :node="node" :formInfo="{ ...formInfo, editable: false }" />

      <div>{{ node.string }}</div>
      <!-- <div>{{ node }}</div> -->
    </template>

    <template v-else>
      <StatText :node="node" :formInfo="{ ...formInfo, editable: false }" />
      <!-- <div>todo stat info</div>
      <div>{{ node.nodename }}</div> -->
      <!-- <div>{{ node }}</div> -->
    </template>
  </span>
</template>

<script setup>
import OdooWidget from '@/odoojs-antdv/OWidget/OdooWidget.vue'
import StatText from './StatText.vue'

import { computed } from 'vue'

const props = defineProps(['node', 'formInfo'])

const nodetype = computed(() => {
  // const nodename = props.node.nodename
  const tagname = props.node.tagname

  if (tagname === 'odoofield') {
    return 'odoofield'
  } else {
    return tagname
  }
})
</script>

<style scoped></style>
